package com.xq.pojo;

import com.xq.annotation.Extract;
import com.xq.annotation.JsoupDocument;


/**
 * 文章内容实体类
 */
@JsoupDocument(domain = "https://zhipeng0908.gitee.io/")
public class ArticleContent {

    @Extract(cssQuery = ".post-body", contentType = 2)
    private String content;

    @Extract(cssQuery = ".my_post_copyright > p:nth-child(5)",prefix = "文章作者:")
    private String author;


    /**
     * 创建时间
     * 创建时间建议由开发者去处理，而不是框架去处理。
     * 一：因为时间格式五花八门，写起来比较繁琐
     * 二：是因为要给注解增加至少两个属性专门用来处理时间格式
     * 三：如果爬取的数据中，时间格式不固定，那么整个程序都无法运行
     */
    @Extract(cssQuery = ".my_post_copyright > p:nth-child(6)", prefix = "发布时间:")
    private String createdTime;


    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    @Override
    public String toString() {
        return "ArticleContent{" +
                "content='" + content + '\'' +
                ", author='" + author + '\'' +
                ", createdTime='" + createdTime + '\'' +
                '}';
    }
}

